package br.com.futebol.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import br.com.futebol.R;

public class PrincipalActivity extends Activity implements OnClickListener {
	private static final String[] FUTEBOL = new String[]{"Futebol 1", "Futebol 2", "Futebol 3"}; 

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		
                      super.onCreate(savedInstanceState);
                      setContentView(R.layout.principal);                       

                      Spinner combo = (Spinner) findViewById(R.id.clubes);
                      ArrayAdapter adp = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, FUTEBOL);
                      adp.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                      combo.setAdapter(adp);
                      
                      Button btSorteioRapido = (Button) findViewById(R.id.soterioRapido);
                      btSorteioRapido.setOnClickListener(this);
	}
	
	public void onClick(View v) {
	
		if (R.id.soterioRapido == v.getId()) {
			//Intent it = new Intent(PrincipalActivity.this, SelecaoGoleiroActivity.class);
			Intent it = new Intent(PrincipalActivity.this, FileChooserActivity.class);
			
				it.putExtra("qtdJogadoresPorTime", "6");
				it.putExtra("CAMINHO", "/sdcard/futebol_teste.txt");
	
				//Log.d("FutebolActivity.onClick - Caminho", getIntent().getStringExtra("CAMINHO"));
				startActivityForResult(it, 3);
		Log.d("Caminho", "passei");
	}
	}
}
